<template>
	
</template>

<script>
	export default{
		const { NovelExtension } = tt;
		
		NovelExtension({
		  lifetimes: {
		    // 在页面加载时立即触发二次跳转
		    attached() {
			  
			  
		      const { book_id, chapter_id } = tt.getCurrentPage().query;
			  
		      const queryString = new URLSearchParams(option).toString();
		      // 添加加载提示
		      tt.showLoading({ title: '加载中', mask: true });
		
		      // 延迟跳转以规避插件初始化冲突
		      setTimeout(() => {
		        tt.redirectTo({
		          url: `/pages/Detail/Detail?bookId=${book_id}&chapterId=${chapter_id}`,
		          success: () => {
		            tt.hideLoading();
		          },
		          fail: (err) => {
		            tt.showToast({ title: '跳转失败', icon: 'none' });
		            console.error('二次跳转失败:', err);
		          }
		        });
		      }, 300); // 300ms延迟确保插件基础初始化完成
		    }
		  },
		
		  // 空实现必要接口避免报错
		  service: {
		    queryContentsInfo() {
		      return { chapterList: [] };
		    },
		    queryLockModalText() {
		      return { title: '', primary: '' };
		    }
		  }
		});
		// onLoad(option) {
		// 	const queryString = new URLSearchParams(option).toString();
		// 	uni.redirectTo({
		// 		url: `/pages/Detail/Detail?${queryString}`
		// 	})
		// }
		
	}
</script>

